package cn.wongshu.student.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import java.util.Date;

/**
 * 实体类
 * @author Administrator
 *
 */
@Data
@Table(name = "category")
public class Category {

	@Id
	private Integer id;//主键
	private Integer level;//优先级
    private String name;
	private String description;//分类描述
    @JsonFormat(pattern = "yyyy-MM-dd")
	private Date createDate;//创建时间
    @JsonFormat(pattern = "yyyy-MM-dd")
	private Date updateDate;//更新时间
	private Integer goodsCount;//分类下商品数量
	private Integer delFlag;//删除标记0为删除

	//扩展字段

    @Transient
	private Date createDateStart;
    @Transient
	private Date createDateEnd;
    @Transient
	private String enabledValue;



    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
        this.enabledValue = delFlag == 1 ? "否":"是";
    }

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public Integer getGoodsCount() {
		return goodsCount;
	}

	public void setGoodsCount(Integer goodsCount) {
		this.goodsCount = goodsCount;
	}

	public Integer getDelFlag() {
		return delFlag;
	}


	public String getEnabledValue() {
		return enabledValue;
	}

	public void setEnabledValue(String enabledValue) {
		this.enabledValue = enabledValue;
	}
}
